package me.maiz.babyisland.service.impl;

import me.maiz.babyisland.dao.model.Product;
import me.maiz.babyisland.dao.ProductMapper;
import me.maiz.babyisland.service.IProductService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import me.maiz.babyisland.dao.ProductMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lucas
 * @since 2019-05-28
 */
@Service
public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> implements IProductService {

    @Autowired
    private ProductMapper productMapper;

    @Override
    public List<Product> findTopSell(int count) {

        List<Product> topProducts = productMapper.selectTop(count);

        return topProducts;
    }
}
